import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class ScannerDemo {

	// Multiplying big numbers
	private static void multiplyBigNumbers() {
		Scanner scan = new Scanner(System.in);
		BigInteger result = BigInteger.ONE;
		while (scan.hasNextBigInteger()) {
			result = result.multiply(scan.nextBigInteger());
		}
		System.out.println(result);
	}

	// Sorting strings
	private static void sortStrigns() {
		Scanner s = new Scanner(System.in);
		ArrayList<String> lines = new ArrayList<String>();
		// To exit the cycle: Ctrl+Z 
		while (s.hasNextLine()) {
			lines.add(s.nextLine());
		}
		Collections.sort(lines);
		for (String line : lines) {
			System.out.println(line);
		}
	}

	public static void main(String[] args) {
		multiplyBigNumbers();
		sortStrigns();
	}

}
